﻿using System;

using System.Collections;

using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

using Global.Class.Library;
using BusinessLogicLayer;
using DataAccessLayer;
using DataTransferObject;
using System.Globalization;
using BrightIdeasSoftware;
using Equin.ApplicationFramework;

namespace PresentationLayer
{
    public partial class GCGBCommand : Form, IMergeToolStrip, ICallToolStrip
    {

        #region <Implement Interface>

        public event PropertyChangedEventHandler PropertyChanged;

        private void NotifyPropertyChanged(string propertyName)
        {
            if (PropertyChanged != null) PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
        }

        public GlobalEnum.TaskID TaskID
        {
            get { return this.gcgbCommandBLL.TaskID; }
        }


        public ToolStrip ChildToolStrip
        {
            get
            {
                return this.toolStripChildForm;
            }
            set
            {
                this.toolStripChildForm = value;
            }
        }





        #region Context toolbar


        public bool IsDirty
        {
            get { return this.gcgbCommandBLL.IsDirty; }
        }

        public bool IsValid
        {
            get { return this.gcgbCommandBLL.IsValid; }
        }

        public bool Closable
        {
            get { return true; }
        }

        public bool Loadable
        {
            get { return true; }
        }

        public bool Newable
        {
            get { return !this.gcgbCommandBLL.ReadOnly; }
        }

        public bool Editable
        {
            get { return this.gcgbCommandBLL.Editable; }
        }

        public bool Deletable
        {
            get { return this.gcgbCommandBLL.Editable; }
        }

        public bool Importable
        {
            get { return true; }
        }

        public bool Exportable
        {
            get { return true; }
        }

        public bool Verifiable
        {
            get { return this.gcgbCommandBLL.Verifiable; }
        }

        public bool Unverifiable
        {
            get { return this.gcgbCommandBLL.Unverifiable; }
        }

        public bool Printable
        {
            get { return false; }
        }

        public bool Searchable
        {
            get { return true; }
        }

        /// <summary>
        /// Edit Mode: True, Read Mode: False
        /// </summary>
        private bool editableMode;
        private int lastGCGBCommandID;
        public bool EditableMode { get { return this.editableMode; } }
        /// <summary>
        /// This reverse of the EditableMode
        /// </summary>
        public bool ReadonlyMode { get { return !this.editableMode; } }

        /// <summary>
        /// Set the editableMode
        /// </summary>
        /// <param name="editableMode"></param>
        private void SetEditableMode(bool editableMode)
        {
            if (this.editableMode != editableMode)
            {
                this.lastGCGBCommandID = this.gcgbCommandBLL.GCGBCommandID;
                this.editableMode = editableMode;
                this.NotifyPropertyChanged("EditableMode");
            }
        }


        private void CancelDirty(bool restoreSavedData)
        {
            try
            {
                if (restoreSavedData || this.gcgbCommandBLL.GCGBCommandID <= 0)
                    this.gcgbCommandBLL.Fill(this.lastGCGBCommandID);

                this.SetEditableMode(false);
            }
            catch (Exception exception)
            {
                throw exception;
            }
        }



        #endregion Context toolbar



        #region ICallToolStrip

        public void Escape()
        {
            if (this.EditableMode)
            {
                if (this.IsDirty)
                {
                    DialogResult dialogResult = MessageBox.Show(this, "Do you want to save your change?", "Warning", MessageBoxButtons.YesNoCancel);
                    if (dialogResult == DialogResult.Yes)
                    {
                        this.Save();
                        if (!this.IsDirty) this.CancelDirty(false);
                    }
                    else if (dialogResult == DialogResult.No)
                    {
                        this.CancelDirty(true);
                    }
                    else
                        return;
                }
                else
                    this.CancelDirty(false);
            }
            else
                this.Close(); //Unload this module
        }

        //Can phai xem lai trong VB de xem lai this.SetEditableMode () khi can thiet

        public void Loading()
        {
            this.GetMasterList();
        }

        public void New()
        {
            this.gcgbCommandBLL.New();
            this.SetEditableMode(true);
        }

        public void Edit()
        {
            this.SetEditableMode(true);
        }

        public void Save()
        {
            this.gcgbCommandBLL.Save();
            this.GetMasterList();
        }

        public void Delete()
        {
            DialogResult dialogResult = MessageBox.Show(this, "Are you sure you want to delete " + this.gcgbCommandBLL.GCGBCommandMaster.GCGBCommandReference + "?", "Warning", MessageBoxButtons.YesNo, MessageBoxIcon.Stop);
            if (dialogResult == DialogResult.Yes)
            {
                try
                {
                    this.gcgbCommandBLL.Delete();
                    this.GetMasterList();
                }
                catch (Exception exception)
                {
                    GlobalExceptionHandler.ShowExceptionMessageBox(this, exception);
                }
            }
        }

        public void Import()
        {
            ImportExcel();
        }

        public void Export()
        {
            try
            {
                if (this.ActiveControl.Equals(this.dataListViewMaster))
                {
                    DataTable dataTableExport;
                    dataTableExport = this.dataListViewMaster.DataSource as DataTable;
                    if (dataTableExport != null) CommonFormAction.Export(dataTableExport);
                }
                else
                {
                    List<GCGBCommandCollection> listExport;
                    listExport = this.gcgbCommandBLL.GCGBCommandCollectionList.ToList();
                    if (listExport != null) CommonFormAction.Export(listExport);
                }
            }
            catch (Exception exception)
            {
                GlobalExceptionHandler.ShowExceptionMessageBox(this, exception);
            }
        }

        public void Verify()
        {
            MessageBox.Show("Verify");
        }

        public void Print(PrintDestination printDestination)
        {
            MessageBox.Show("Print");
        }

        public void SearchText(string searchText)
        {
            CommonFormAction.OLVFilter(this.dataListViewMaster, searchText);
        }

        #endregion


        #endregion <Implement Interface>








        #region <Storage>
        private GCGBCommandBLL gcgbCommandBLL;

        #endregion <Storage>


        public GCGBCommand()
        {
            try
            {
                InitializeComponent();

                this.gcgbCommandBLL = new GCGBCommandBLL();

                this.gcgbCommandBLL.PropertyChanged += new PropertyChangedEventHandler(gcgbCommandBLL_PropertyChanged);                

            }
            catch (Exception exception)
            {
                GlobalExceptionHandler.ShowExceptionMessageBox(this, exception);
            }
        }

        void gcgbCommandBLL_PropertyChanged(object sender, PropertyChangedEventArgs e)
        {
            this.NotifyPropertyChanged(e.PropertyName);
        }


        private void GCGBCommand_Load(object sender, EventArgs e)
        {
            try
            {
                InitializeCommonControlBinding();

                InitializeDataGridBinding();

                InitializeReadOnlyModeBinding();
            }
            catch (Exception exception)
            {
                GlobalExceptionHandler.ShowExceptionMessageBox(this, exception);
            }
        }


        #region <InitializeBinding>

        Binding gcgbCommandTypeIDBinding;

        Binding preparedEmployeeIDBinding;
        Binding approvedEmployeeIDBinding;


        Binding gcgbCommandReferenceBinding;
        Binding descriptionBinding;
        Binding remarksBinding;

        Binding gcgbCommandDateBinding;
        Binding entryDateBinding;

        Binding isDirtyBinding;
        Binding isDirtyBLLBinding;

        private void InitializeCommonControlBinding()
        {
            CommonMetaList commonMetaList = new CommonMetaList();



            ERmgrVCP.ListGCGBCommandTypeDataTable gcgbCommandTypeListDataTable = commonMetaList.GetGCGBCommandType();
            this.comboBoxGCGBCommandTypeID.DataSource = gcgbCommandTypeListDataTable;
            this.comboBoxGCGBCommandTypeID.DisplayMember = gcgbCommandTypeListDataTable.DescriptionColumn.ColumnName;
            this.comboBoxGCGBCommandTypeID.ValueMember = gcgbCommandTypeListDataTable.GCGBCommandTypeIDColumn.ColumnName;
            this.gcgbCommandTypeIDBinding = this.comboBoxGCGBCommandTypeID.DataBindings.Add("SelectedValue", this.gcgbCommandBLL.GCGBCommandMaster, "GCGBCommandTypeID", true);



            ERmgrVCP.ListEmployeeMasterDataTable listEmployeeMasterDataTable = commonMetaList.GetEmployeeMaster();
            this.comboBoxPreparedEmployeeID.DataSource = listEmployeeMasterDataTable;
            this.comboBoxPreparedEmployeeID.DisplayMember = listEmployeeMasterDataTable.FullNameColumn.ColumnName;
            this.comboBoxPreparedEmployeeID.ValueMember = listEmployeeMasterDataTable.EmployeeIDColumn.ColumnName;
            this.preparedEmployeeIDBinding = this.comboBoxPreparedEmployeeID.DataBindings.Add("SelectedValue", this.gcgbCommandBLL.GCGBCommandMaster, "PreparedEmployeeID", true);


            listEmployeeMasterDataTable = (ERmgrVCP.ListEmployeeMasterDataTable)listEmployeeMasterDataTable.Copy();
            this.comboBoxApprovedEmployeeID.DataSource = listEmployeeMasterDataTable;
            this.comboBoxApprovedEmployeeID.DisplayMember = listEmployeeMasterDataTable.FullNameColumn.ColumnName;
            this.comboBoxApprovedEmployeeID.ValueMember = listEmployeeMasterDataTable.EmployeeIDColumn.ColumnName;
            this.approvedEmployeeIDBinding = this.comboBoxApprovedEmployeeID.DataBindings.Add("SelectedValue", this.gcgbCommandBLL.GCGBCommandMaster, "ApprovedEmployeeID", true);


            this.gcgbCommandReferenceBinding = this.textBoxGCGBCommandReference.DataBindings.Add("Text", this.gcgbCommandBLL.GCGBCommandMaster, "GCGBCommandReference", true);
            this.descriptionBinding = this.textBoxDescription.DataBindings.Add("Text", this.gcgbCommandBLL.GCGBCommandMaster, "Description", true);
            this.remarksBinding = this.textBoxRemarks.DataBindings.Add("Text", this.gcgbCommandBLL.GCGBCommandMaster, "Remarks", true);


            this.gcgbCommandDateBinding = this.dateTimePickerGCGBCommandDate.DataBindings.Add("Value", this.gcgbCommandBLL.GCGBCommandMaster, "GCGBCommandDate", true);
            this.entryDateBinding = this.dateTimePickerEntryDate.DataBindings.Add("Value", this.gcgbCommandBLL.GCGBCommandMaster, "EntryDate", true);

            this.isDirtyBinding = this.checkBoxIsDirty.DataBindings.Add("Checked", this.gcgbCommandBLL.GCGBCommandMaster, "IsDirty", true);
            this.isDirtyBLLBinding = this.checkBoxIsDirtyBLL.DataBindings.Add("Checked", this.gcgbCommandBLL, "IsDirty", true);



            this.gcgbCommandTypeIDBinding.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.preparedEmployeeIDBinding.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.approvedEmployeeIDBinding.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);


            this.gcgbCommandReferenceBinding.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.descriptionBinding.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.remarksBinding.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);

            this.gcgbCommandDateBinding.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.entryDateBinding.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);

            this.isDirtyBinding.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);
            this.isDirtyBLLBinding.BindingComplete += new BindingCompleteEventHandler(CommonControl_BindingComplete);

            this.naviGroupDetails.DataBindings.Add("ExpandedHeight", this.numericUpDownSizingDetail, "Value", true, DataSourceUpdateMode.OnPropertyChanged);
            this.numericUpDownSizingDetail.Minimum = this.naviGroupDetails.HeaderHeight * 2;
            this.numericUpDownSizingDetail.Maximum = this.naviGroupDetails.Height + this.dataListViewMaster.Height;

            this.tableLayoutPanelMaster.ColumnStyles[this.tableLayoutPanelMaster.ColumnCount - 1].SizeType = SizeType.Absolute; this.tableLayoutPanelMaster.ColumnStyles[this.tableLayoutPanelMaster.ColumnCount - 1].Width = 10;
            this.tableLayoutPanelExtend.ColumnStyles[this.tableLayoutPanelExtend.ColumnCount - 1].SizeType = SizeType.Absolute; this.tableLayoutPanelExtend.ColumnStyles[this.tableLayoutPanelExtend.ColumnCount - 1].Width = 10;

            this.errorProviderMaster.DataSource = this.gcgbCommandBLL.GCGBCommandMaster;
        }


        private void CommonControl_BindingComplete(object sender, BindingCompleteEventArgs e)
        {
            if (e.BindingCompleteState == BindingCompleteState.Exception) { GlobalExceptionHandler.ShowExceptionMessageBox(this, e.ErrorText); e.Cancel = true; }
        }

        private void numericUpDownSizingDetail_ValueChanged(object sender, EventArgs e)
        {
            this.naviGroupDetails.Expand();
        }

        private void naviGroupDetails_HeaderMouseClick(object sender, MouseEventArgs e)
        {
            this.numericUpDownSizingDetail.Visible = this.naviGroupDetails.Expanded;
            this.toolStripNaviGroupDetails.Visible = this.naviGroupDetails.Expanded;
        }

        private void toolStripButtonShowDetailsExtend_Click(object sender, EventArgs e)
        {
            this.naviGroupDetailsExtend.Expanded = !this.naviGroupDetailsExtend.Expanded;
            this.toolStripButtonShowDetailsExtend.Image = this.naviGroupDetailsExtend.Expanded ? ResourceIcon.Chevron_Collapse.ToBitmap() : ResourceIcon.Chevron_Expand.ToBitmap();
        }


        private void GetMasterList()
        {
            this.dataListViewMaster.SetNativeBackgroundTiledImage(global::PresentationLayer.Properties.Resources.Background2);

            foreach (OLVColumn olvColumn in dataListViewMaster.Columns) { olvColumn.Renderer = null; }

            DataTable dataTableGCGBCommandListing = this.gcgbCommandBLL.GCGBCommandListing(GlobalVariables.GlobalOptionSetting.LowerFillterDate, GlobalVariables.GlobalOptionSetting.UpperFillterDate);
            dataTableGCGBCommandListing.TableName = "GCGBCommandListing";

            DataSet bindingDataSet = new DataSet();
            bindingDataSet.Tables.Add(dataTableGCGBCommandListing);

            this.dataListViewMaster.AutoGenerateColumns = false;
            this.dataListViewMaster.DataSource = dataTableGCGBCommandListing;
        }

        private void InitializeDataGridBinding()
        {

            this.GetMasterList();



            #region <dataGridViewDetail>

            CommonMetaList commonMetaList = new CommonMetaList();
            DataGridViewComboBoxColumn comboBoxColumn;

            //<dataGridViewGCGBCommandCollection>
            ERmgrVCP.ListMaterialSetNameDataTable listMaterialSetNameDataTable = commonMetaList.GetMaterialSetName(true);
            comboBoxColumn = (DataGridViewComboBoxColumn)this.dataGridViewGCGBCommandCollection.Columns[listMaterialSetNameDataTable.MaterialSetIDColumn.ColumnName];
            comboBoxColumn.DataSource = listMaterialSetNameDataTable;
            comboBoxColumn.DisplayMember = listMaterialSetNameDataTable.DescriptionColumn.ColumnName;
            comboBoxColumn.ValueMember = listMaterialSetNameDataTable.MaterialSetIDColumn.ColumnName;


            ERmgrVCP.ListMaterialSemiNameDataTable listMaterialSemiDataTable = commonMetaList.GetMaterialSemiName(true);
            comboBoxColumn = (DataGridViewComboBoxColumn)this.dataGridViewGCGBCommandCollection.Columns["MaterialSemiID1"];
            comboBoxColumn.DataSource = listMaterialSemiDataTable;
            comboBoxColumn.DisplayMember = listMaterialSemiDataTable.DescriptionColumn.ColumnName;
            comboBoxColumn.ValueMember = listMaterialSemiDataTable.MaterialSemiIDColumn.ColumnName;

            comboBoxColumn = (DataGridViewComboBoxColumn)this.dataGridViewGCGBCommandCollection.Columns["MaterialSemiID2"];
            comboBoxColumn.DataSource = listMaterialSemiDataTable;
            comboBoxColumn.DisplayMember = listMaterialSemiDataTable.DescriptionColumn.ColumnName;
            comboBoxColumn.ValueMember = listMaterialSemiDataTable.MaterialSemiIDColumn.ColumnName;

            comboBoxColumn = (DataGridViewComboBoxColumn)this.dataGridViewGCGBCommandCollection.Columns["MaterialSemiID3"];
            comboBoxColumn.DataSource = listMaterialSemiDataTable;
            comboBoxColumn.DisplayMember = listMaterialSemiDataTable.DescriptionColumn.ColumnName;
            comboBoxColumn.ValueMember = listMaterialSemiDataTable.MaterialSemiIDColumn.ColumnName;


            this.dataGridViewGCGBCommandCollection.AutoGenerateColumns = false;
            gcgbCommandCollectionListView = new BindingListView<GCGBCommandCollection>(this.gcgbCommandBLL.GCGBCommandCollectionList);
            this.dataGridViewGCGBCommandCollection.DataSource = gcgbCommandCollectionListView;

            StackedHeaderDecorator stackedHeaderDecorator = new StackedHeaderDecorator(this.dataGridViewGCGBCommandCollection);

            this.dataGridViewGCGBCommandCollection.ColumnWidthChanged += new DataGridViewColumnEventHandler(dataGridViewGCGBCommandCollection_ColumnWidthChanged);

            #endregion <dataGridViewDetail>
        }


        private void InitializeReadOnlyModeBinding()
        {
            List<Control> controlList = GlobalStaticFunction.GetAllControls(this);

            foreach (Control control in controlList)
            {
                //if (control is TextBox) control.DataBindings.Add("Readonly", this, "ReadonlyMode");
                if (control is TextBox) control.DataBindings.Add("Enabled", this, "EditableMode");
                else if (control is ComboBox || control is DateTimePicker) control.DataBindings.Add("Enabled", this, "EditableMode");
                else if (control is DataGridView)
                {
                    control.DataBindings.Add("Readonly", this, "ReadonlyMode");
                    control.DataBindings.Add("AllowUserToAddRows", this, "EditableMode");
                    control.DataBindings.Add("AllowUserToDeleteRows", this, "EditableMode");
                }
            }

            this.dataListViewMaster.DataBindings.Add("Enabled", this, "ReadonlyMode");
        }

        BindingListView<GCGBCommandCollection> gcgbCommandCollectionListView;
        private void filterTextBox_TextChanged(object sender, EventArgs e)
        {// Change the filter of the view.
            //gcgbCommandCollectionListView.ApplyFilter(
            //    delegate(gcgbCommandCollectionListView marketingPaymentDetail)
            //    {
            //        // uses ToLower() to ignore case of text.
            //        return marketingPaymentDetail.CustomerCode.ToLower().Contains(filterTextBox.Text.ToLower());
            //    }
            //);


        }

        #endregion <InitializeBinding>





        #region Import Excel

        private void ImportExcel()
        {
            try
            {
                OpenFileDialog openFileDialog = new OpenFileDialog();
                openFileDialog.Filter = "Excel File (.xlsx)|*.xlsx";

                if (openFileDialog.ShowDialog() == DialogResult.OK)
                {
                    DialogMapExcelColumn dialogMapExcelColumn = new DialogMapExcelColumn(OleDbDatabase.MappingTaskID.GCGBCommand, openFileDialog.FileName);

                    if (dialogMapExcelColumn.ShowDialog() == DialogResult.OK)
                    {
                        dialogMapExcelColumn.Dispose();
                        if (this.gcgbCommandBLL.ImportExcel(openFileDialog.FileName))
                            MessageBox.Show(this, "Congratulation!" + "\r\n" + "\r\n" + "File: " + openFileDialog.FileName + " is imported successfull!" + "\r\n" + "\r\n" + "Please press OK to finish.", "Importing", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                }

            }
            catch (Exception exception)
            {
                GlobalExceptionHandler.ShowExceptionMessageBox(this, exception);
            }

        }








        #endregion Import Excel

        private void dataGridViewGCGBCommandCollection_ColumnWidthChanged(object sender, DataGridViewColumnEventArgs e)
        {
            int X1 = this.dataGridViewGCGBCommandCollection.GetCellDisplayRectangle(this.dataGridViewGCGBCommandCollection.Columns["Quantity"].Index, -1, true).Location.X;
            int X2 = this.dataGridViewGCGBCommandCollection.GetCellDisplayRectangle(this.dataGridViewGCGBCommandCollection.Columns["QuantitySemi1"].Index, -1, true).Location.X;
            int X3 = this.dataGridViewGCGBCommandCollection.GetCellDisplayRectangle(this.dataGridViewGCGBCommandCollection.Columns["QuantitySemi2"].Index, -1, true).Location.X;
            int X4 = this.dataGridViewGCGBCommandCollection.GetCellDisplayRectangle(this.dataGridViewGCGBCommandCollection.Columns["QuantitySemi3"].Index, -1, true).Location.X;

            int Y = this.textBoxTotalQuantity.Location.Y;

            this.textBoxTotalQuantity.Width = this.dataGridViewGCGBCommandCollection.Columns["Quantity"].Width;
            this.textBoxTotalQuantity.Location = new Point(X1, Y);

            this.textBoxTotalQuantitySemi1.Width = this.dataGridViewGCGBCommandCollection.Columns["QuantitySemi1"].Width;
            this.textBoxTotalQuantitySemi1.Location = new Point(X2, Y);

            this.textBoxTotalQuantitySemi2.Width = this.dataGridViewGCGBCommandCollection.Columns["QuantitySemi2"].Width;
            this.textBoxTotalQuantitySemi2.Location = new Point(X3, Y);

            this.textBoxTotalQuantitySemi3.Width = this.dataGridViewGCGBCommandCollection.Columns["QuantitySemi3"].Width;
            this.textBoxTotalQuantitySemi3.Location = new Point(X4, Y);
        }

        private void dataListViewMaster_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                ObjectListView objectListView = (ObjectListView)sender;
                DataRowView row = (DataRowView)objectListView.SelectedObject;

                if (row != null)
                {
                    int gcgbCommandID;

                    if (int.TryParse(row.Row["GCGBCommandID"].ToString(), out gcgbCommandID)) this.gcgbCommandBLL.Fill(gcgbCommandID);
                    else this.gcgbCommandBLL.Fill(0);
                }
                else this.gcgbCommandBLL.Fill(0);
            }
            catch (Exception exception)
            {
                GlobalExceptionHandler.ShowExceptionMessageBox(this, exception);
            }
        }

        private void dataGridViewGCGBCommandCollection_RowPostPaint(object sender, DataGridViewRowPostPaintEventArgs e)
        {
            try
            {
                using (SolidBrush b = new SolidBrush(this.dataGridViewGCGBCommandCollection.RowHeadersDefaultCellStyle.ForeColor))
                {
                    e.Graphics.DrawString((e.RowIndex + 1).ToString(), e.InheritedRowStyle.Font, b, e.RowBounds.Location.X + 15, e.RowBounds.Location.Y + 4);
                }
            }
            catch (Exception exception)
            {
                GlobalExceptionHandler.ShowExceptionMessageBox(this, exception);
            }
        }


        private void dataGridViewGCGBCommandCollection_CellEndEdit(object sender, DataGridViewCellEventArgs e)
        {
            try
            {
                GCGBCommandCollection gcgbCommandCollection = ((ObjectView<GCGBCommandCollection>)this.dataGridViewGCGBCommandCollection.Rows[e.RowIndex].DataBoundItem).Object as GCGBCommandCollection;
                if (gcgbCommandCollection != null) this.gcgbCommandBLL.InitializeMaterialSet(gcgbCommandCollection);

            }
            catch (Exception exception)
            {
                GlobalExceptionHandler.ShowExceptionMessageBox(this, exception);
            }
        }

        private void splitContainer1_Panel2_Paint(object sender, PaintEventArgs e)
        {

        }




    }




}
